home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!j-bg.demon.co.uk
- From: John Sargent <jb@j-bg.demon.co.uk>
- Newsgroups: comp.lang.c++
- Subject: Re: main()
- Date: Thu, 18 Apr 96 18:16:00 GMT
- Message-ID: <829851360snz@j-bg.demon.co.uk>
- References: <3174c0dc.7652220@news.flex.com.au> <829766541snz@j-bg.demon.co.uk> <Dq1C8B.3sC@news.hawaii.edu>
- Reply-To: jb@j-bg.demon.co.uk
- X-NNTP-Posting-Host: j-bg.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.29
- X-Mail2News-Path: j-bg.demon.co.uk
-
- In article <Dq1C8B.3sC@news.hawaii.edu>
- xea0005@co.honolulu.hi.us "Alvin Nonaka" writes:
-
- > I believe the authors intended to say:
- >
- > #include <stdio.h>
- > #include <stdlib.h>
- > void main(void)
- > {
- > printf("Hello!\n");
- > exit(0);
- > }
- >
- > 'main' can't return. Calling 'exit' is better because the call to exit
- > 'cleans up' all resource allocations (which you are supposed to handle)
- > left pending in your code.
-
- What do you mean, 'main' can't return? It can, and does; it's just that in
- this instance, it doesn't return a value.
-
-
- Regards,
- John Sargent
-